<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ChangeGoodsImageTableToInnodb extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('goods_image');
        Schema::create('goods_image', function (Blueprint $table) {
            $table->engine='innoDb';
            $table->increments('goods_image_id')->comment('主键 自增 无意义');
            $table->integer('goods_id')->comment('商品goods(spu)表的外键');
            $table->string('image',255)->nullable()->comment('spu轮播图片');
            $table->tinyInteger('is_default')->default(0)->comment('是否是默认主图 0-否 1-是');
            $table->tinyInteger('disabled')->default(0)->comment('删除状态 0-未删除 1-删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
